package com.inspinia.auth.sso.client.config;

import com.baomidou.kisso.SSOConfig;
import com.baomidou.kisso.web.WebKissoConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebSsoInterceptorConfig extends WebMvcConfigurerAdapter {

    @Bean
    public SSOConfig ssoConfig(){
        SSOConfig ssoConfig = new SSOConfig();
        ssoConfig.setCookieName("ins_token");
        return ssoConfig;
    }

    @Bean(initMethod = "initKisso")
    public WebKissoConfigurer webKissoConfigurer(){
        WebKissoConfigurer configurer = new WebKissoConfigurer();
        configurer.setSsoPropPath("sso.properties");
        return configurer;
    }
}